/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.put.netbeans.dcs_modeler.actions;

import java.util.logging.Logger;
import org.netbeans.api.project.Project;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.actions.CookieAction;
import org.put.netbeans.dcs_modeler.dataObjects.DCSModelDefinitionDataObject;

public final class DCSModelerAction extends CookieAction
{
    private static Logger log =
            Logger.getLogger( DCSModelerOpenSuport.class.getName() );
    
    protected void performAction( Node[] activatedNodes )
    {
        //Project project = activatedNodes[0].getLookup().lookup( Project.class );
        log.info( "Created new workflow definition file" );
        if ( activatedNodes.length != 0 )
        {
            DCSModelDefinitionDataObject d = ( DCSModelDefinitionDataObject )activatedNodes[0].getLookup().lookup( DCSModelDefinitionDataObject.class );
            log.info( "Created modeler object for " + d.getPrimaryFile().getName() );
        }
    }

    protected int mode()
    {
        return CookieAction.MODE_EXACTLY_ONE;
    }

    public String getName()
    {
        return NbBundle.getMessage( DCSModelerAction.class, "CTL_DCSModelerAction" );
    }

    protected Class[] cookieClasses()
    {
        return new Class[]{ Project.class };
    }

    @Override
    protected String iconResource()
    {
        return "org/put/netbeans/dcs_modeler/palette/images/workflow_simple_case_16x16.png";
    }

    public HelpCtx getHelpCtx()
    {
        return HelpCtx.DEFAULT_HELP;
    }

    @Override
    protected boolean asynchronous()
    {
        return false;
    }
}

